import { CommandBuilder } from '../../classes/command';

export const EchoCommand = new CommandBuilder(
  'echo',
  'Echos what the user inputs',
)
  .setRequiredPermissions('8')
  .addStringOption(msg =>
    msg
      .setName('message')
      .setDescription('Message to reply with')
      .setRequired(true),
  )
  .requireBotPermission('developer')
  .register() // this builds, registers and returns a Command - not a CommandBuilder!
  .on('run', e => {
    e.reply(e.options.getString('message')?.trim() || 'No message.');
  });
export default EchoCommand;
